/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mygameframework.scenes;

import com.mygameframework.sprite.Sprite;
import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;

/**
 * 布景管理系统
 * @author bill
 */
public abstract class Scene {
    protected Rectangle2D bounds;
    protected Rectangle2D viewable;

    public final Rectangle2D getBounds() {
        return bounds;
    }

    public final Rectangle2D getViewable() {
        return viewable;
    }

    public final void setBounds(Rectangle2D r) {
        this.bounds = new Rectangle2D.Double(r.getX(),r.getY(),r.getWidth(),r.getHeight());
    }

    public final void setViewable(Rectangle2D r) {
        this.viewable =new Rectangle2D.Double(r.getX(),r.getY(),r.getWidth(),r.getHeight());
    }
    public Scene(Rectangle2D v,Rectangle2D b){
        setViewable(v);
        setBounds(b);
    }
    public void add(Sprite sprite){
        //TODO ADD sprite
    }
    public abstract void update(long times);
    public abstract void paint(Graphics2D g2);
}
